<?php
if(!isset($_SESSION))
    session_start();
// 存储 session 数据
$ini_array = parse_ini_file("qiao.ini");
$host = $ini_array[ip_address];
$username = $_POST["username"];
$password = $_POST['pwd'];
$_SESSION['uname']=$username;
if(isset($_SESSION['views']))
{
	$_SESSION['views']=$_SESSION['views']+1;
}
else
{
	$_SESSION['views']=1;
}
$viewtime=$_SESSION['views'];
if($viewtime > 4){
 header("Location:".$host."/relogin.php");  
}
require_once '20161010_1.php';
$sql = "SELECT count(*) from userinfo WHERE user_name='$username' and user_password = '$password'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result, MYSQLI_NUM);
if($row[0] >0){
 header("Location:".$host."/userpage.php");
}else{
  header("Location:".$host."/login.php");
}

mysqli_close ($conn) ;

?>